<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui">

	<ui:composition template="/templates/masterLayout.xhtml">
		<ui:define name="content">
			<h:form id="nhanVienListFormId">
				<p:dataTable id="nhanVienDataTableId" value="#{nhanVienView.dataModel}" selection="#{nhanVienView.selectedEntities}"
					paginator="true" var="entity" rows="10"
					paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}"
					lazy="true" paginatorPosition="bottom">
					<p:ajax event="rowDblselect" listener="#{nhanVienView.editAction}" partialSubmit="true"
						oncomplete="nhanVienDialog.show()" update=":nhanVienDetailFormId:nhanVienPanelGridId" />
					<f:facet name="header">
						<p:commandButton icon="ui-icon-plus" value="Tạo mới" action="#{nhanVienView.newAction}"
							actionListener="#{nhanVienView.reset}" update=":nhanVienDetailFormId:nhanVienPanelGridId"
							oncomplete="nhanVienDialog.show()" style="float:left" />
						<div style="clear: both;" />
					</f:facet>

					<p:column selectionMode="multiple" style="width:1%" />

					<p:column headerText="Tên" sortBy="#{entity.name}">
						<h:outputText value="#{entity.name}" />
					</p:column>
					<p:column headerText="Số CMND">
						<h:outputText value="#{entity.cmnd}" />
					</p:column>
					<p:column headerText="Loại">
						<h:outputText value="#{entity.loai.name}" />
					</p:column>
					<p:column headerText="Lương tháng">
						<h:outputText value="#{entity.luongThang}" />
					</p:column>
					<p:column headerText="Địa chỉ">
						<h:outputText value="#{entity.address}" />
					</p:column>
					<p:column headerText="Email">
						<h:outputText value="#{entity.email}" />
					</p:column>
					<p:column headerText="Số đt">
						<h:outputText value="#{entity.phone}" />
					</p:column>
					<p:column headerText="Fax">
						<h:outputText value="#{entity.fax}" />
					</p:column>
					<p:column headerText="Thông tin">
						<h:outputText value="#{entity.thongTin}" />
					</p:column>
					<f:facet name="footer">
					</f:facet>
				</p:dataTable>

				<p:confirmDialog id="nhanVienDeleteConfirmDialogId" message="Bạn muốn xóa nhân viên?"
					header="Xác nhận xóa nhân viên" severity="alert" widgetVar="nhanVienDeleteConfirmDialog">

					<p:commandButton id="deleteYesId" value="Yes" update=":nhanVienListFormId:nhanVienDataTableId"
						oncomplete="nhanVienDeleteConfirmDialog.hide()" action="#{nhanVienView.deleteAction}" />
					<p:commandButton id="deleteNoId" value="No" immediate="true" onclick="nhanVienDeleteConfirmDialog.hide()"
						type="button" />
				</p:confirmDialog>
			</h:form>

			<ui:include src="nhanVienDetails.xhtml" />
		</ui:define>
	</ui:composition>


</ui:composition>